#include <stdio.h>

union EndianCheck
{
    int num;
    char bytes[4];
};

void test(){
    union EndianCheck check;
    check.num = 1;

    if(check.bytes[0] == 1)
    {
        printf("小端模式\n");
    }
    else
    {
        printf("大端模式\n");
    }
}

int main()
{
    test();
    return 0;
}

